package com.spring.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.spring.api.entity.User;
import com.spring.api.service.UserService;

@RestController
public class HelloController {

	@Autowired
	private UserService userService;
	
	@RequestMapping(value="/say/{name}")
	@ResponseBody
	public String sayHello(@PathVariable(value="name")String name){
		User user = userService.findUserById(1);
		System.out.println(user.getUsername());
		return "hello to ," + name;
	}

	
}
